{extend name="layout/layout" /}
<!--请在下方写此页面body相关内容-->
{block name="container"}
<article class="page-container">
    <form class="form form-horizontal" id="form" method="post" >
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>管理员账号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <label><?php echo $info['username']?></label>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户组：</label>
            <div class="formControls col-xs-8 col-sm-9"><span class="select-box">
                <select class="select" name="group_id" size="1">
                    <?php foreach($group as $v){ if(empty($v['deep']) || $v['deep'] == 0){ ?>
                    <option value="<?php echo $v['id']?>" <?php echo $v['id'] == $info['group_id'] ?'selected' : '' ?>><?php echo $v['group_name']?></option>
                    <?php } if(!empty($v['deep']) && $v['deep'] == 1){ ?>
                    <option value="<?php echo $v['id']?>" <?php echo $v['id'] == $info['group_id'] ?'selected' : '' ?>><?php echo str_repeat('&nbsp', 4).'-'.$v['group_name'];?></option>
                    <?php } }?>
                </select>
			</span></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input type="hidden" value="<?php echo $info['id']?>" name="id">
                <input type="hidden" value="<?php echo $info['username']?>" name="username">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
{/block}
<!--请在上方方写此页面body相关内容-->

<!--请在下方写此页面业务相关的脚本-->
{block name="js"}
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });

    $("#form").validate({
        rules:{
            group_id:{required:true,}
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            var options = {
                beforeSubmit: function () {
                    load = layer.load();
                },
                success: function(obj){
                    if(obj.code !== 0){
                        layer.msg(obj.msg,{ icon:5, time:2000 });
                    } else {
                        layer.msg(obj.msg, { icon: 1, time: 1000 }, function(){
                            closeWindow();
                        });
                    }
                    layer.close(load);
                }
            };
            $(form).ajaxSubmit(options);
        }
    });
});
</script>
{/block}
<!--/请在上方写此页面业务相关的脚本-->